package com.pai4j.search;

import com.pai4j.common.util.SpringContextUtil;
import com.pai4j.search.messagequeue.consumer.*;
import com.pai4j.search.service.voctor.ArticleMilvusService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@EnableDiscoveryClient
@ComponentScan("com.pai4j")
@EnableFeignClients("com.pai4j.remote")
public class Pai4jSearchApplication {

    public static void main(String[] args) {
        SpringApplication.run(Pai4jSearchApplication.class, args);

        /**
         * 服务启动成功后开启队列消费(文章数据同步Milvus)
         */
        //SpringContextUtil.getBean(ArticleSyncRedisQueueConsumer.class).initBean();

        //SpringContextUtil.getBean(ArticleMilvusService.class).consumeTask();

        SpringContextUtil.getBean(ChatMessageSyncRedisQueueConsumer.class).initBean();
        SpringContextUtil.getBean(AccountSyncRedisQueueConsumer.class).initBean();
        SpringContextUtil.getBean(SubjectArticleSyncRedisQueueConsumer.class).initBean();
        SpringContextUtil.getBean(MomentSyncRedisQueueConsumer.class).initBean();
    }
}
